﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace Perovich.GameObjects.Attributes
{
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
    public class AutomaticPropertyAttribute : Attribute
    {
        readonly string name;

        public string Name
        {
            get { return name; }
        }

        readonly Type type;

        public Type Type
        {
            get { return type; }
        }

        readonly string target;
        readonly string access;

        public string Access
        {
            get { return access; }
        }

        public string Target
        {
            get { return target; }
        }

        private string summary = "";

        public string XmlSummary
        {
            get
            {
                return summary;
            }
            set
            {
                summary = value;
            }
        }

        private string value;
        private System.Type cType = null;

        public System.Type CType
        {
            get { return cType; }
            set { cType = value; }
        }
        private string funct = null;

        public string Funct
        {
            get { return funct; }
            set { funct = value; }
        }

        public string XmlReturns
        {
            get
            {
                return value;
            }
            set
            {
                this.value = value;
            }
        }

        public bool IsReadOnly { get; set; }

        public AutomaticPropertyAttribute(string name, Type type)
        {
            this.name = name;
            this.type = type;
            this.target = null;
            this.access = "public";
            IsReadOnly = false;
        }

        public AutomaticPropertyAttribute(string name, string target)
        {
            this.name = name;
            this.target = target;
            this.type = null;
            this.access = "public";
            IsReadOnly = false;
        }
        public AutomaticPropertyAttribute(string name, Type type, string access)
        {
            this.name = name;
            this.type = type;
            this.target = null;
            this.access = access;
            IsReadOnly = false;
        }

        public AutomaticPropertyAttribute(string name, string target, string access)
        {
            this.name = name;
            this.target = target;
            this.type = null;
            this.access = access;
            IsReadOnly = false;
        }

        public AutomaticPropertyAttribute(Type t, string funct)
        {
            this.cType = t;
            this.funct = funct;
        }
    }
}
